<?php

namespace app\common\validate;

use think\Validate;

class Merchant extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
		'merchant_phone' => 'require|mobile',
		'merchant_password' => 'require',
		'shop_logo' => 'require',
		'shop_name' => 'require',
		'shop_banner' => 'require',
		'service' => 'require',
		'address' => 'require',
//		'introduction' => 'require',
//		'alipay_account' => 'require',
		'alipay_name' => 'require',
		'notice' => 'require',
		'longitude' => 'require',
		'latitude' => 'require',
		'open_time' => 'require',
		'night_time' => 'require',

    ];
    /**
     * 提示消息
     */
    protected $message = [
		'merchant_phone.require' => '账号不能为空',
		'merchant_phone.mobile' => '账号必须为手机号格式',
		'merchant_password.require' => '密码不能为空',
		'shop_logo.require' => '请上传店铺LOGO',
		'shop_name.require' => '请输入店铺名称',
		'shop_banner.require' => '请上传店铺轮播图',
		'service.require' => '请选择店铺服务',
		'address.require' => '请选择店铺地址',
		'introduction.require' => '请输入店铺简介',
		'alipay_account.require' => '请输入支付宝账号',
		'alipay_name.require' => '请输入支付宝姓名',
		'notice.require' => '请输入预定须知',
	    'longitude.require' => '请上传经纬度',
	    'latitude.require' => '请上传经纬度',
        'open_time.require' => '营业时间不能为空',
        'night_time.require' => '夜间取还车时间不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['merchant_phone','merchant_password','shop_name','alipay_name','address'],
        'edit' => [],
	    'apiedit' => ['open_time', 'night_time'],
    ];
    
}
